<!DOCTYPE html>
<!-- saved from url=(0035)https://segmentfault.com/user/login -->
<html lang="zh-CN"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    
    <meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">
    <meta name="renderer" content="webkit">
    <meta property="qc:admins" content="15317273575564615446375">
    <meta property="og:image" content="https://sf-static.b0.upaiyun.com/v-576b52d9/global/img/touch-icon.png">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <meta name="alexaVerifyID" content="LkzCRJ7rPEUwt6fVey2vhxiw1vQ">
    <meta name="apple-itunes-app" content="app-id=958101793, app-argument=">
    <title>登录 - SegmentFault</title>
        <meta name="description" content="SegmentFault ( www.sf.gg ) 是中国领先的开发者技术社区。 我们希望为编程爱好者提供一个纯粹、高质的技术交流的平台， 与开发者一起学习、交流与成长，创造属于开发者的时代！">
        
            <meta name="keywords" content="SegmentFault,黑客马拉松,IT技术社区,编程社区,技术问答,技术文章,技术笔记,技术活动,程序员招聘,开发者,程序员,极客,编程,代码,开源,hackathon">    
        
    <link rel="search" type="application/opensearchdescription+xml" href="https://segmentfault.com/opensearch.xml" title="SegmentFault">
    <link rel="apple-touch-icon" href="https://sf-static.b0.upaiyun.com/v-576b52d9/global/img/touch-icon.png">

    <meta name="msapplication-TileColor" content="#009a61">
    <meta name="msapplication-square150x150logo" content="https://sf-static.b0.upaiyun.com/v-576b52d9/global/img/touch-icon.png">

    
    <link rel="alternate" type="application/atom+xml" title="SegmentFault 最新问题" href="https://segmentfault.com/feeds/questions">
    <link rel="alternate" type="application/atom+xml" title="SegmentFault 最新文章" href="https://segmentfault.com/feeds/blogs">
    
    
    
    
    
    <link rel="stylesheet" href="__PUBLIC__/css/global.css">
    <link rel="stylesheet" href="__PUBLIC__/css/user.css">
    <link rel="stylesheet" href="__PUBLIC__/css/responsive.css">
    
    
    <!--[if lt IE 9]>
    <link rel="stylesheet" href="https://sf-static.b0.upaiyun.com/v-576b52d9/global/css/ie.css"/>
    <script src="https://sf-static.b0.upaiyun.com/v-576b52d9/global/script/html5shiv.js"></script>
    <script src="https://sf-static.b0.upaiyun.com/v-576b52d9/global/script/respond.js"></script>
    <![endif]-->
<script type="text/javascript" src="__PUBLIC__/js/jquery.min.js"></script>
</head>

<body data-mod="user" class="user-login
">
<!--[if lt IE 9]>
<div class="alert alert-danger topframe" role="alert">你的浏览器实在<strong>太太太太太太旧了</strong>，放学别走，升级完浏览器再说 <a target="_blank" class="alert-link" href="http://browsehappy.com">立即升级</a>
</div>
<![endif]-->


<img id="icon4weChat" style="height: 0;width: 0;" data-src="https://sf-static.b0.upaiyun.com/v-576b52d9/global/img/touch-icon-512.png">


<img id="icon4weChat" data-src="https://sf-static.b0.upaiyun.com/v-576b52d9/global/img/touch-icon-512.png">

<div class="container">
    <div class="header text-center">
    <h1>
        <a href="https://segmentfault.com/" class="logo">
            <img src="__PUBLIC__/images/logo-b.svg" alt="SegmentFault">
        </a>
    </h1>
        <p class="description text-muted">欢迎加入专业的中文开发者社区</p>
    </div>
        <div class="row bg-white login">
        <div class="col-md-4 col-sm-12 col-md-push-7 login-wrap">
                <h1 class="h4 text-muted login-title mb30">用户登录</h1>
            <form action="{:U('index/login/login')}" method="POST" role="form" class="mt30">
                <div class="form-group">
                    <label for="mail" class="control-label">Email</label>
                    <input type="email" id="login_check" class="form-control" name="mail" required="" placeholder="hello@segmentfault.com">
                    <span class='login_check_notice'></span>
                </div>
                <div class="form-group">
                    <label for="password" class="control-label">密码</label>
                    <input type="password" class="form-control" name="password" required="" placeholder="密码">
                </div>
                <div class="form-group clearfix">
                    <div class="checkbox pull-left">
                        <label><input name="remember" type="checkbox" value="1" checked=""> 记住登录状态</label>
                    </div>
                    <button type="submit" id="login_btn" class="btn btn-primary pull-right pl20 pr20 " disabled="">登录</button>
                </div>
            </form>
            <p class="h4 text-muted visible-xs-block mb30 hidden-xs">快速登录</p>
            <div class="widget-login mt30">
                <p class="text-muted mt5 mr10 pull-left hidden-xs">快速登录</p>
                <a href="https://segmentfault.com/user/oauth/weixin" class="btn pl5 pr5 mb5 btn-default btn-sm btn-sn-weixin visible-xs hidden"><span class="icon-sn-bg-weixin"></span><strong class="visible-xs-inline">微信账号</strong></a>
                <a href="https://segmentfault.com/user/oauth/google" class="btn pl5 pr5 mb5 btn-default btn-sm btn-sn-google visible-xs"><span class="icon-sn-bg-google"></span><strong class="visible-xs-inline">Google 账号</strong></a>
                <a href="https://segmentfault.com/user/oauth/google" class="btn pl5 pr5 mb5 btn-default btn-sm btn-sn-google hidden-xs"><span class="icon-sn-bg-google"></span><strong class="visible-xs-inline">Google 账号</strong></a>
                <a href="https://segmentfault.com/user/oauth/github" class="btn pl5 pr5 mb5 btn-default btn-sm btn-sn-github hidden-xs"><span class="icon-sn-bg-github"></span><strong class="visible-xs-inline">Github 账号</strong></a>
                <a href="https://segmentfault.com/user/oauth/github" class="btn pl5 pr5 mb5 btn-default btn-sm btn-sn-github visible-xs"><span class="icon-sn-bg-github"></span><strong class="visible-xs-inline">Github 账号</strong></a>
                <a href="https://segmentfault.com/user/oauth/weibo" class="btn pl5 pr5 mb5 btn-default btn-sm btn-sn-weibo hidden-xs"><span class="icon-sn-bg-weibo"></span><strong class="visible-xs-inline">新浪微博账号</strong></a>
                <a href="https://segmentfault.com/user/oauth/qq" class="btn pl5 pr5 mb5 btn-default btn-sm btn-sn-qq visible-xs"><span class="icon-sn-bg-qq"></span><strong class="visible-xs-inline">QQ 账号</strong></a>
                <a href="https://segmentfault.com/user/oauth/qq" class="btn pl5 pr5 mb5 btn-default btn-sm btn-sn-qq hidden-xs"><span class="icon-sn-bg-qq"></span><strong class="visible-xs-inline">QQ 账号</strong></a>
                <a href="https://segmentfault.com/user/oauth/weixin" class="btn pl5 pr5 mb5 btn-default btn-sm btn-sn-weixin hidden-xs"><span class="icon-sn-bg-weixin"></span><strong class="visible-xs-inline">微信账号</strong></a>
                <a id="showMore" href="javascript:;" class="btn pl5 pr5 mb5 btn-default btn-sm btn-sn-dotted"><span class="icon-sn-bg-dotted"></span><strong class="visible-xs-inline">•••</strong></a>

                <a href="https://segmentfault.com/user/oauth/twitter" class="btn pl5 pr5 mb5 btn-default btn-sn-twitter btn-sm hidden"><span class="icon-sn-bg-twitter"></span></a>
                <a href="https://segmentfault.com/user/oauth/facebook" class="btn pl5 pr5 mb5 btn-default btn-sn-facebook btn-sm hidden"><span class="icon-sn-bg-facebook"></span></a>
                <a href="https://segmentfault.com/user/oauth/douban" class="btn pl5 pr5 mb5 btn-default btn-sn-douban btn-sm hidden"><span class="icon-sn-bg-douban"></span></a>
            </div>
        </div>
                <div class="login-vline hidden-sm hidden-xs"></div>
        <div class="col-md-4 col-md-pull-3 col-sm-12 login-wrap">
            <h1 class="h4 text-muted login-title mb30">创建新账号</h1>
            <form action="{:U('index/register/index')}" method="POST" role="form" class="mt30">
                <div class="form-group">
                    <label for="name" class="control-label">用户名</label>
                    <input type="text" class="form-control data_check" name="name" required="" regcheck='' placeholder="字母、数字等，用户名唯一">
                    <span class='data_check_notice help-block err'></span>
                </div>
                <div class="form-group">
                    <label for="mail" class="control-label ">Email</label>
                    <input type="email" class="form-control data_check" name="mail" required="" regcheck='' placeholder="hello@segmentfault.com">
                    <span class='data_check_notice help-block err'></span>
                </div>
                <div class="form-group">
                    <label for="password" class="control-label ">密码</label>
                    <input type="password" class="form-control data_check" name="password" regcheck='' required="" placeholder="不少于 6 位">
                    <span class='data_check_notice help-block err'></span>
                </div>
                <div class="form-group" >
                    <label class="required control-label" for="captcha">验证码</label>
                    <input type="text" class="form-control data_check" id="loginCaptcha " name="captcha" regcheck='' placeholder="请输入下方的验证码"> 
                    <span class='data_check_notice help-block err'></span>
                    <div class="mt10"><a id="reloadCaptcha" href="javascript:void(0)"><img class="captcha" id='clickcaptcha' src="{: U('Index/login/captcha')}" width="240" height="50"></a></div>
                </div>
                <div class="form-group clearfix">
                    <div class="checkbox pull-left">
                        同意并接受<a href="https://segmentfault.com/tos" target="_blank">《服务条款》</a>
                    </div>
                    <button type="submit" class="btn btn-primary pl20 pr20 pull-right" id="regbtn" disabled="">注册</button>
                </div>
            </form>
        </div>
    </div>
            <div class="text-center col-md-12 login-link">
        <a href="https://segmentfault.com/user/forgot">找回密码</a>
                |
        <a href="https://segmentfault.com/">首页</a>
                |
        <a href="https://segmentfault.com/user/register">创建新账号</a>
    </div>
</div>


<script type="text/javascript">
    
    $(function(){


         $('.data_check').blur(function(event) {
              var this1 = $(this);
              var value = $(this).val();
              var data_name = $(this).attr('name');

              // var obj = {data_name:value};

              $.ajax({
                url: "{:U('Index/register/checkdata')}",
                type: 'POST',
                dataType: 'json',
                data: data_name+"="+value,
                success:function(data){
                  if(data.error=='1'){
                    this1.siblings('.data_check_notice').html('通过');
                    this1.attr({ regcheck: 'regcheck'});

                    var c = 1;
                    var obj = $('.data_check');

                    $.each(obj, function(index, val) {
                       if($(this).attr('regcheck')==''){
                          c=0;
                       }
                    });

                    if(c){
                      $('#regbtn').removeAttr('disabled');
                    }


                  }else{
                    this1.siblings('.data_check_notice').html(data.info);
                  }
                },
                error:function(data){
                  alert(data);
                }

              })

          });

    })

    $('#clickcaptcha').click(function(event) {
        $(this).attr({
            src: '{: U('Index/login/captcha')}/'+Math.random()
        });
    });

    $('#login_check').blur(function(event) {
        var this1= $(this);
        var email =$(this).val();

        $.ajax({
            url: "{:U('index/login/checkemail')}",
            type: 'post',
            dataType: 'json',
            data: {email: email},
        })
        .done(function(data) {
            if(data.error==0){
               this1.siblings('.login_check_notice').html(data.info);
                $('#login_btn').Attr('disabled','');
            }else{
                 this1.siblings('.login_check_notice').html(data.info);
                $('#login_btn').removeAttr('disabled');
            }
            
        })
    });




</script>




</body></html>